<!DOCTYPE html>
<html lang="zh-cn">
<head>
    <title>登录</title>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <meta name="renderer" content="webkit" />
	<meta name="Keywords" content="比特活智能物业平台" />
	<link rel="stylesheet" href="__PUBLIC__/css/pintuer.css" />
	<link rel="stylesheet" href="__PUBLIC__/css/Frame.css" />
	<script src="__PUBLIC__/js/jquery.js"></script>
	<script src="__PUBLIC__/js/pintuer.js"></script>
	<script src="__PUBLIC__/js/Frame.js"></script>
</head>
<body>
    <div class="loginImg">
		<div class="loginCircle line form-x">
			<div class="loginForm height float-left">
				<div class="form-group">
					<div class="label text-white">
						<label for="username">账号</label>
					</div>
					<div class="field">
						<input type="text" class="input" id="username" name="username" size="50" placeholder="账号" />
					</div>
				</div>
				<div class="form-group">
					<div class="label text-white">
						<label for="password">密码</label>
					</div>
					<div class="field">
						<input type="password" class="input" id="password" name="password" size="50" placeholder="请输入密码" />
					</div>
				</div>
				<div class="form-group">
					<div class="label text-white">
						<label for="code">验证码</label>
					</div>
					<div class="field codeText">
						<input type="text" class="input" id="code" name="code" size="50" />
					</div>
					<div class="code float-right">
						<img src="__URL__/code" onclick="this.src=this.src+'?a='+Math.random()" />
					</div>
				</div>
			</div>
			<div class="form-button">
				<div class="loginOK">
					<input type="button" class="loginBtn border-none"  id='User_Login' />
				</div>
			</div>
			<div class="clear"></div>
			<div class="edition height-big">
				<span>阳光水岸 v2.1.6</span>
			</div>
		</div>
    </div>

<script>

$(".loginImg").height($(window).height());

var winH = $(window).height();
var cirH = $(".loginCircle").height();
var formH = $(".loginForm").height();
var okH = $(".form-button").height();
var marT = (cirH - formH)/2 ;
var topH = (cirH - okH) /2 ;
var cirH = (winH - 600)/2;
$(".loginCircle").css("margin-top", cirH + "px");
$(".loginForm").css("margin-top", marT + "px");
$(".form-button").css("top", topH + "px");
var winW = $(window).width();
if(winW <1920){
	$(".loginImg").removeClass("loginImgBig");
	$(".loginImg").addClass("loginImgSmall");
}else{
	$(".loginImg").addClass("loginImgBig");
	$(".loginImg").removeClass("loginImgSmall");
}

$(function(){
	$('#User_Login').click(function(){
		var User_Name = $('input[name=username]').val().trim();
		var User_Pwd= $('input[name=password]').val().trim();
		var Code = $('input[name=code]').val().trim();
		if(!User_Name || !User_Pwd || !Code){
			alert('账号信息和验证码不得为空！');
		}
		$.ajax({
			url:'login_c',
			data:{
				name:User_Name,
				pwd:User_Pwd,
				code:Code
			},
			type:'post',
			success:function(res){
				switch(res){
					case 'e1':
						alert('信息不得为空');
						break;
					case 'e2':
						alert('验证码不正确');
						break;
					case 'e3':
						alert('用户名或密码错误');
						break;
					case 'ok':
						location.href='__MODULE__/Index/index';
						break;
				}
			}
		});
	});
});
</script>
</body></html>